package pm_01;

import java.util.Scanner;

public class EducationSystem {
    String isContinue = "y";

    public void startRun() {

        do {
            SystemMenu.printLoginAndRegisterMenu();
            Scanner sc = new Scanner(System.in);
            int userSelect = sc.nextInt();
            switch (userSelect) {
                case 1 -> {
                    System.out.println("欢迎使用登录系统");
                }
                case 2 -> {
                    System.out.println("欢迎使用注册功能");
                }
                case 3 -> {
                    System.out.println("是否要退出本系统？（y|N）");
                    String confirm = sc.next();
                    if (confirm.equalsIgnoreCase("y")) {
                        System.out.println("Bye!");
                        System.exit(0);
                    }
                }
                default -> {
                    System.out.println("您的选择有误");
                }


            }
            System.out.println("是否真的要退出本系统？（Y|N）");
            isContinue = sc.next();
        } while (isContinue.equalsIgnoreCase("n"));
        System.out.println("Bye!");
    }
}
